package com.baizhiedu.baizhiappsys.controller;

import com.baizhiedu.baizhiappsys.service.ChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author lby
 */
@Controller
@RequestMapping("chart")
public class ChartController {
    @Autowired
    private ChartService chartService;
    /**
     * 设置支付方式的饼状图
     * categories 支付方式的集合
     * chartData 数据的集合 value: 135,
     //					name: '银联支付'
     * @return
     */
    @RequestMapping("setUserPie")
    @ResponseBody
    public Map setUserPie() {
        return chartService.getUserPieData();
    }

    /**
     * 设置热销课程
     * courseNameList x轴
     * courseClickVolumeList 课程点击数
     * courseBuyVolumeList 课程购买数
     * @return
     */
    @RequestMapping("setCourseBar")
    @ResponseBody
    public Map setCourseBar(){
        return chartService.setCourseBar();
    }
}
